package com.xxl.job.admin.core.model;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import lombok.Data;

/**
 * Created by xuxueli on 16/9/30.
 */
@Data
public class XxlJobGroup extends Model<XxlJobGroup> {

    private int id;
    private String appName;
    private String title;

    private int order;
    /**
     * 执行器地址类型：0=自动注册、1=手动录入
     */
    private int addressType;

    /**
     * 执行器地址列表，多地址逗号分隔(手动录入)
     */
    private String addressList;

    /**
     * 执行器地址列表(系统注册)
     */
    private List<String> registryList;

    public List<String> getRegistryList() {
        if (addressList != null && addressList.trim().length() > 0) {
            registryList = new ArrayList<>(Arrays.asList(addressList.split(",")));
        }
        return registryList;
    }

}
